// 定义PO模型类
class PODetail {
  final String id;
  final String orderNumber;
  final String itemNumber;
  final String location;
  final int requiredQuantity;

  PODetail({
    required this.id,
    required this.orderNumber,
    required this.itemNumber,
    required this.location,
    required this.requiredQuantity,
  });

  // 从接口数据转换为模型对象
  factory PODetail.fromJson(Map<String, dynamic> json) {
    return PODetail(
      id: json['id']?.toString() ?? '',
      orderNumber: json['order_number'] ?? '',
      itemNumber: json['item_number'] ?? '',
      location: json['location'] ?? '',
      requiredQuantity: json['required_quantity'] ?? 0,
    );
  }
}